#ifndef __TollgateScene_H__ 
#define __TollgateScene_H__ 

#include "cocos2d.h" 
#include "Tank.h"
#include "Player.h"
#include "TiledMapInfo.h"
#include "EnemyManager.h"
#include "BulletManager.h"
#include "cocostudio\CocoStudio.h"
#include "ui\CocosGUI.h"

USING_NS_CC; 
using namespace cocos2d::ui;

enum Status{
	RUNNING,
	LOSE,
	WIN,
};

class TollgateScene :public Layer{ 
public:
	static Scene* createScene(int level);
	static TollgateScene* create(int level);
	bool init(int level);

	void addPlayer(TMXTiledMap* map);

	CC_SYNTHESIZE(int, m_level, Level);

	void bindListener();
	void update(float dt);
	void addBullet(Entity* entity, Vec2 pos, bool isPlayer, int atk, int bul);
	void playerFire(float dt);
	void setNotification();
	void removeNotification();
	void win(Ref*);
	void lose(Ref*);
	
	void timeCounter(float dt);
	
	void onClickNextBtn(Ref*, TouchEventType type);
	void onClickReplayBtn(Ref*, TouchEventType type);
	void onClickBackBtn(Ref*, TouchEventType type);

private:
	
	Player* m_player;
	bool isMouseDown;
	Node* m_status;
	int m_musicNum;
	Status status;
	float m_time;
	EnemyManager* m_enemyManager;
	BulletManager* m_bulletManager;
}; 


#endif // __TollgateScene_H__ 

